package find_friend.po.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import find_friend.po.Message;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
@Entity
@Table(name = "MessageWithPic")
public class MessageWithPic extends Message implements Serializable {
    public MessageWithPic(Message message){
        this.messageid=message.getMessageid();
        this.content=message.getContent();
        this.createtime=message.getCreatetime();
        this.type=message.getType();
        this.userid=message.getUserid();
    }

    @Id
    private String messageid;

    private String content;

    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date createtime;

    private String userid;

    private Integer type;

    private static final long serialVersionUID = 1L;

    public String getMessageid() {
        return messageid;
    }

    public void setMessageid(String messageid) {
        this.messageid = messageid;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Date getCreatetime() {
        return createtime;
    }

    public void setCreatetime(Date createtime) {
        this.createtime = createtime;
    }

    public String getUserid() {
        return userid;
    }

    public void setUserid(String userid) {
        this.userid = userid;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getUserPic() {
        return userPic;
    }

    public void setUserPic(String userPic) {
        this.userPic = userPic;
    }

    private String userPic;

}
